package com.mayikt;

import java.util.concurrent.CountDownLatch;

/**
 * @ClassName Test035
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test035 {
    public static void main(String[] args) {
        CountDownLatch countDownLatch = new CountDownLatch(2);
        new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + ":1");
            try {
                countDownLatch.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + ":2");
        }).start();
        countDownLatch.countDown();
        countDownLatch.countDown();
    }
}
